import { Modal, Table } from 'antd';
import React from 'react';


export default function TableModal({ visible, dataSource, onCancel }) {
  const columns = [
    {
      title: '名称',
      dataIndex: 'name',
      key: 'name',
    },
    {
      title: '描述',
      dataIndex: 'description',
      key: 'description',
    },
  ];
  return (
    <Modal
      visible={visible}
      onCancel={onCancel}
    >
      <Table
        style={{ marginTop: '20px' }}
        dataSource={dataSource}
        columns={columns}
        rowKey="name"
      />
    </Modal>
  );
}
